import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
const path = require("path");

// https://vitejs.dev/config/
export default defineConfig({
  // 设置打包路径
  base: "./",
  resolve: {
    // 配置别名
    alias: {
      "@": path.resolve(__dirname, "src"),
    },
  },
  plugins: [vue()],
  server: {
    // 做ip配置，从ip启动
    host: "0.0.0.0",
  },
  css: {
    // css预处理器
    preprocessorOptions: {
      // 配置less，设置less全局文件
      less: {
        charset: false,
        additionalData: '@import "@/assets/css/base.less";',
      },
    },
  },
});
